Sz is not intended be called from cu(1) or other communications programs. Unix flavors of Omen Technology's Professional-YAM communications software are available for dial-out applications.
Sz sends one or more files with ZMODEM protocol.
ZMODEM greatly simplifies file transfers compared to XMODEM. In addition to a friendly user interface, ZMODEM provides Personal Computer and other users an efficient, accurate, and robust file transfer method.
ZMODEM provides complete END-TO-END data integrity between application programs. ZMODEM's 32 bit CRC catches errors that sneak into even the most advanced networks.
Advanced file management features include AutoDownload (Automatic file Download initiated without user intervention), Display of individual and total file lengths and transmission time estimates, Crash Recovery, selective file transfers, and preservation of exact file date and length.
The -y option instructs the receiver to open the file for writing unconditionally. The -a option causes the receiver to convert Unix newlines to PC-DOS carriage returns and linefeeds.
Sb batch sends one or more files with YMODEM or ZMODEM protocol. The initial ZMODEM initialization is not sent. When requested by the receiver, sb supports YMODEM-g with "cbreak" tty mode, XON/XOFF flow control, and interrupt character set to CAN (^X). YMODEM-g (Professional-YAM g option) increases throughput over error free channels (direct connection, X.PC, etc.) by not acknowledging each transmitted sector.
On Unix systems, additional information about the file is transmitted. If the receiving program uses this information, the transmitted file length controls the exact number of bytes written to the output dataset, and the modify time and file mode are set accordingly.
Sx sends a single file with XMODEM or XMODEM-1k protocol (sometimes incorrectly called "ymodem"). The user must supply the file name to both sending and receiving programs.
Iff sz is invoked with $SHELL set and iff that variable contains the string rsh or rksh (restricted shell), sz operates in restricted mode. Restricted mode restricts pathnames to the current directory and PUBDIR (usually /usr/spool/uucppublic) and/or subdirectories thereof.
The fourth form sends a single COMMAND to a ZMODEM receiver for execution. Sz exits with the COMMAND return value. If COMMAND includes spaces or characters special to the shell, it must be quoted.
The fifth form sends a single COMMAND to a ZMODEM receiver for execution. Sz exits as soon as the receiver has correctly received the command, before it is executed.
The sixth form (sz -TT) attempts to output all 256 code combinations to the terminal. In you are having difficulty sending files, this command lets you see which character codes are being eaten by the operating system.
If sz is invoked with stdout and stderr to different datasets, Verbose is set to 2, causing frame by frame progress reports to stderr. This may be disabled with the q option.
The meanings of the available options are:
% sz -Yan *.c *.h
Send only the .c and .h files that exist on both systems,
and are newer on the sending system than the
corresponding version on the receiving system, converting Unix to
DOS text format.
$ sz -\Yan file1.c file2.c file3.c foo.h baz.h
(for VMS)
ZMODEM Command Download
(Unix to Professional-YAM)
cpszall:all
sz -c "c:;cd /yam/dist"
sz -ya $(YD)/*.me
sz -yqb y*.exe
sz -c "cd /yam"
sz -i "!insms"
This Makefile fragment uses
sz
to issue commands to Professional-YAM to change current disk and directory.
Next,
sz
transfers the
.me
files from the $YD directory, commanding the receiver to overwrite the old files
and to convert from Unix end of line conventions to PC-DOS conventions.
The third line transfers some
.exe
files.
The fourth and fifth lines command Pro-YAM to
change directory and execute a PC-DOS batch file
insms .
Since the batch file takes considerable time, the
-i
form is used to allow
sz
to exit immediately.
XMODEM File Transfer
(Unix to Crosstalk)
%
sx -a foo.c
ESC
rx foo.c
The above three commands transfer a single file
from Unix to a PC and Crosstalk with
sz
translating Unix newlines to DOS CR/LF.
This combination is much slower and far less reliable than ZMODEM.
Compile time options required for various operating systems are described in the source file.
The current VMS version does not support XMODEM, XMODEM-1k, or YMODEM.
VMS C Standard I/O and RMS may interact to modify the file contents.
sz.c, crctab.c, rbsb.c, zm.c, zmodem.h Unix source files
sz.c, crctab.c, vrzsz.c, zm.c, zmodem.h, vmodem.h, vvmodem.c, VMS source files.
/tmp/szlog stores debugging output (sz -vv) (szlog on VMS).
After 5 packets, sz stops the "transfer" and prints the total number of characters "sent" (Tcount). The difference between Tcount and 5120 represents the number of characters stored in various buffers when the Attn sequence is generated.
If a program that does not properly implement the specified file transfer protocol causes sb to "hang" the port after a failed transfer, either wait for sb to time out or keyboard a dozen Ctrl-X characters. Every reported instance of this problem has been corrected by using ZCOMM, Pro-YAM, DSZ, or other program with a correct implementation of the specified protocol.
Many programs claiming to support YMODEM only support XMODEM with 1k blocks, and they often don't get that quite right. XMODEM transfers add up to 127 garbage bytes per file. XMODEM-1k and YMODEM-1k transfers use 128 byte blocks to avoid extra padding.
YMODEM programs use the file length transmitted at the beginning of the transfer to prune the file to the correct length; this may cause problems with source files that grow during the course of the transfer. This problem does not pertain to ZMODEM transfers, which preserve the exact file length unconditionally.
Most ZMODEM options are merely passed to the receiving program; some programs do not implement all of these options.
Circular buffering and a ZMODEM sliding window should be used when input is from pipes instead of acknowledging frames each 1024 bytes. If no files can be opened, sz sends a ZMODEM command to echo a suitable complaint; perhaps it should check for the presence of at least one accessible file before getting hot and bothered.
A few high speed modems have a firmware bug that drops characters when the direction of high speed transmissson is reversed. The environment variable ZNULLS may be used to specify the number of nulls to send before a ZDATA frame. Values of 101 for a 4.77 mHz PC and 124 for an AT are typical.
The test mode leaves a zero length file on the receiving system.